package com.fudan.framework.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.NoRepositoryBean;

/**
 * jpa的基础实现，重载部分接口
 * @author Xuxinxing
 *
 * @param <T>
 * @param <ID>
 */
@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends CrudRepository<T, ID>,JpaRepository<T, ID>,JpaSpecificationExecutor<T> {
	T findOneWithCondition(T condition);
	List<T> findAllWithPage(int page,int size);
	List<T> findAllWithCondition(T condition);
	List<T> findAllWithPageAndCondition(int page,int size,T condition);
	long countWithCondition(T condition);
	T getById(Object id);
	List<T> findAllWithTermAndAbbr(String fieldName, String value, int page, int size);
}
